package com.lyx.crm.service;

import com.lyx.crm.base.BaseService;
import com.lyx.crm.dao.PermissionMapper;
import com.lyx.crm.vo.Permission;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Package: com.lyx.crm.service
 * @ClassName: PermissonService
 * @Author: lyx
 * @CreateTime: 2021/9/7 21:21
 * @Description:
 */
@Service
public class PermissionService extends BaseService<Permission, Integer> {


    @Autowired
    private PermissionMapper permissionMapper;

    /**
     * 通过查询用户id拥有角色，角色拥有的资源，得到用户拥有的资源列表（资源权限码）
     *
     * @param userId
     * @return
     */
    public List<String> queryUserHasRolePermissionByUserId(int userId) {

        return permissionMapper.queryUserHasRolePermissionByUserId(userId);
    }
}
